package Factory;

import Factory.Car.Aodi;
import Factory.Car.Benchi;
import Factory.Car.Bmw;
import Factory.Car.CarAbstract;

public class CarFactory {
    public static CarAbstract getCar(String carName){
        CarAbstract car = null;
        if(carName.equalsIgnoreCase("奔驰")){
            car = new Benchi();
        }
        else if(carName.equalsIgnoreCase("奥迪")){
            car = new Aodi();
        }
        else if(carName.equalsIgnoreCase("宝马")){
            car = new Bmw();
        }
        return car;
    }
}
